package com.linkgie.galaxyframework.service.business.web;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

import com.linkgie.galaxyframework.metadata.DataEntity;
import com.linkgie.galaxyframework.metadata.DataField;
import com.linkgie.galaxyframework.metadata.DataInterface;
import com.linkgie.galaxyframework.metadata.DataKey;
import com.linkgie.galaxyframework.metadata.DataLabel;
import com.linkgie.galaxyframework.metadata.DataType;
import com.linkgie.galaxyframework.service.business.data.Business;

/**
 * 业务领域的视图对象(ViewObject)；
 * 
 * @author huanghaiquan
 *
 */
@DataInterface
@DataEntity
public class BusinessVO implements Business, BusinessEditableVI, BusinessVI {

	@DataKey
	@DataField(name = "Id", order = 0)
	private String id;

	@NotBlank(message = "编码为空")
	@DataField(name = "编码", order = 1)
	private String code;

	@Size(min = 1, max = 30)
	@NotBlank(message = "名称为空")
	@DataLabel
	@DataField(name = "名称", order = 2)
	private String name;

	@NotBlank(message = "状态")
	@DataType(contentType = "enum;strict=true;true='正常';false='关闭'")
	@DataField(name = "状态", order = 3)
	private boolean open;

	@NotBlank(message = "来源")
	@DataType(contentType = "enum;strict=true;true='用户';false='系统'")
	@DataField(name = "来源", order = 3)
	private boolean custom;

	@DataType(contentType = "plain;multiline=true")
	@DataField(name = "描述", order = 10)
	private String description;

	@Override
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Override
	public String getCode() {
		return code;
	}

	@Override
	public void setCode(String code) {
		this.code = code;
	}

	@Override
	public String getName() {
		return name;
	}

	@Override
	public void setName(String name) {
		this.name = name;
	}

	@Override
	public boolean isOpen() {
		return open;
	}

	@Override
	public void setOpen(boolean open) {
		this.open = open;
	}

	@Override
	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

//	@Override
//	public String getUid() {
//		return uid;
//	}
//
//	public void setUid(String uid) {
//		this.uid = uid;
//	}

	@Override
	public boolean isCustom() {
		return custom;
	}

	@Override
	public void setCustom(boolean custom) {
		this.custom = custom;
	}

}
